package com.wanxi;

import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class MyINetAddress {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress inetAddress=InetAddress.getByName("localhost");
        System.out.println(inetAddress);
        System.out.println(inetAddress.getHostName());
        System.out.println(inetAddress.getHostAddress());
    }
}
